<?php
namespace app\admin\controller;
use app\admin\model\Dyongjin;
use app\admin\model\Pyongjin;

class Daili extends Base
{
    /**
     * 默认代理拥金等级
     * @return \think\response\View
     */
    public function index()
    {
        $dyj = new Dyongjin();
        $list = $dyj->where('isalone',0)->where('enable',0)->select();
        $this->assign('list',$list);
        return view();
    }

    /**
     * 修改默认代理佣金比例
     * @return \think\response\View
     */
    public function modPrecent()
    {
        $data = input();
        $dyj = new Dyongjin();
        $dyj->where('id',$data['id'])->update(['baifenbi'=>$data['bl']]);
        return $this->returnOk();
    }

    /**
     * 删除默认代理佣金比例
     * @return \think\response\View
     */
    public function delPrecent()
    {
        $data = input();
        $dyj = new Dyongjin();
        $dyj->where('id',$data['id'])->update(['enable'=>1]);
        return $this->returnOk();
    }
   
    
//    function add(){
//        return view();
//    }
//
//    function del(){
//
//    }
    
    /**
     * 普通用户佣金等级
     * @return \think\response\View
     */
    public function user()
    {
        $pyj = new Pyongjin();
        $list = $pyj->select();
        $this->assign('list',$list);
        return view();
    }

    /**
     * 修改普通用户佣金比例
     * @return \think\response\View
     */
    public function comPrecent()
    {
        $data = input();
        $pyj = new Pyongjin();
        $pyj->where('id',$data['id'])->update(['baifenbi'=>$data['bl']]);
        return $this->returnOk();
    }

    /**
     * 删除普通用户佣金比例
     * @return \think\response\View
     */
    public function comdel()
    {
        $data = input();
        $pyj = new Pyongjin();
        $pyj->where('id',$data['id'])->update(['enable'=>1]);
        return $this->returnOk();
    }
    
    function uadd(){
        return view();
    }
    
    function udel(){
    
    }
    function save() {
        
    }
    function usave() {
        
    }
}
